package com.itheima.controller;

import com.itheima.pojo.OperateLog;
import com.itheima.pojo.PageResult;
import com.itheima.pojo.QueryString;
import com.itheima.pojo.Result;
import com.itheima.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hu
 * @date 2025/3/13
 */
@RestController
@RequestMapping("/log")
@Slf4j
public class LogController {

    @Autowired
    private EmpService empService;
    /**
     * 日志信息的分页查询
     */
    @GetMapping("/page")
    public Result page(QueryString query) {
        log.info("分页参数{}", query.toString());
        PageResult<OperateLog> logPageResult = empService.page(query);
        return Result.success(logPageResult);
    }
}
